<!DOCTYPE html>
<html lang="en">

<head>
 <meta charset="UTF-8">
 <meta name="viewport"
  content="width=device-width, initial-scale=1.0, minimum-scale=1,maximum-scale=1,user-scalable=no">
 <meta http-equiv="X-UA-Compatible" content="ie=edge">
 <title data-ch="恐龙探险" data-en="Dinosaur Adventure" class="document_title">恐龙探险</title>
 <script src="js/jquery-3.3.1.min.js"></script>
 <script src="js/common.js"></script>
 <script src="js/rem.js"></script>
 <script src="js/layer.js"></script>
 <script type="text/javascript">
  isLogin();
 </script>
 <link rel="stylesheet" href="css/common.css">
 <link rel="stylesheet" href="css/index.css">
</head>

<body>
 <!--头部-->
 <div class=" jui_top_bar">
  <a class="jui_top_left" href="javascript:history.back(-1)"><img src="icons/back.png"></a>
  <div class="jui_top_middle font_weight" data-ch="转换鸡肉" data-en="Convert meat">转换鸡肉</div>
 </div>
 <!-- 头部end -->
 <!-- 主体部分开始 -->
 <div class="zhuan_jirou_box jui_main col_fff">
  <div class="zhuan_jirou border_radius03 padding_032 latout_mask">
   <div class="f32 zhuan_jirou_num text_center">0.00</div>
   <div class="f28 text_center opacity_09 zhuan_jirou_zong col_fff" data-ch="收益总值" data-en="Total income">收益总值</div>
   <div class="f28 flex_ce">
    <div class="zhuan_jirou_deng text_center col_fff" data-ch="1收益=1个鸡肉" data-en="1 income=1 meat">1收益=1个鸡肉</div>
    <img class="zhuan_jirou_meat" src="./icons/nav_icon02.png" alt="">
   </div>
   <div class="zhuan_jirou_pass">
    <div class="f30 col_fff" data-ch="转换数量" data-en="Number of conversions">转换数量</div>
    <input id="tuan_zhuan_num" type="text" data-ch="最少转换100" data-en="Convert at least 100" placeholder="最少转换100">
   </div>
   
   <div class="zhuan_jirou_pass">
    <div class="f30 col_fff" data-ch="请输入交易密码" data-en="Please enter secondary password">请输入交易密码</div>
    <input id="tuan_zhuan_pass" type="password">
   </div>
   <div class="zhuan_jirou_btn border_radius05 text_center col_fff" data-ch="确认" data-en="Confirm">确认</div>
  </div>
 </div>

 <script src="js/jquery-3.3.1.min.js"></script>
 <script>
  $(function(){
   // 获取可套现的总额
   let data1 = {
    uid: localStorage.getItem("u_id"),
    token: localStorage.getItem("token"),
    language_type: localStorage.getItem("language_type"),
    l_type: 3
   }
   $.ajax({
    type: 'post',
    url: baseURL + '/index.php?m=index&c=wallet_log',
    data: data1,
    success: function success(data) {
     data = JSON.parse(data);
	 is_login(data);
     if (data.code == 1) {
     $(".zhuan_jirou_num").html(Number(data.user.m_credit_3).toFixed(2))

     } else {
      box_timer(data.msg);
     }
    }
   })

   $(".zhuan_jirou_btn").click(function () {
    let language_type = localStorage.getItem("language_type");
    let num = $("#tuan_zhuan_num").val();
    let pass = $("#tuan_zhuan_pass").val();
    if(!num){
    box_timer(language_type == 1 ? '请输入转换数量' : 'Please enter the quantity of transfer');
    } else if(!pass){
    box_timer(language_type == 1 ? '请输入交易密码' : 'Please enter secondary password');
    } else{
     let data = {
      uid: localStorage.getItem("u_id"),
      token: localStorage.getItem("token"),
      language_type: localStorage.getItem("language_type"),
      m_pass: pass,
      m_num: num
     }
     $.ajax({
      type: 'post',
      url: baseURL + '/index.php?m=index&c=asset_sale',
      data: data,
      success: function seccess(data){
       data = JSON.parse(data);
       is_login(data);
       box_timer(data.msg);
       setTimeout(function(){
        window.history.go(-1) // 返回上一页
       },1500)
      }
     })
    }
   })

   language();
   documentName()
  })

  
 </script>
</body>

</html>